package pl.eurobank.dev.controller;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import pl.eurobank.dev.dao.InvestmentFundDAOImpl;
import pl.eurobank.dev.model.InvestmentFund;

@Controller
@RequestMapping("/investment_fund")
public class InvestmentFundController {

    @RequestMapping(value = "/")
    public String index(HttpServletRequest request,HttpServletResponse response,Model model) {      

    	InvestmentFundDAOImpl investFundDaoObj = new InvestmentFundDAOImpl();
        ArrayList<InvestmentFund> investFundList = (ArrayList<InvestmentFund>) investFundDaoObj.getInvestFundList();
          
        model.addAttribute("investmentFundList", investFundList);      
                
        return "/WEB-INF/views/investment_fund/index.jsp";
    }
}

